requestScreenCapture();
var captureImg = captureScreen();
var ocrResults = toArray(gmlkit.ocr(captureImg, "zh").toArray(3));
setTimeout(() => {
  captureImg.recycle();
});
function toArray(arrLike) {
  var array = [];
  for (var index = 0; index < arrLike.length; index++) {
    array.push(arrLike[index]);
  }
  return array;
}
var ocrItem = ocrResults.find((item) => item.text == "主页");
if(ocrItem){
    console.log(ocrItem.bounds.left);
    console.log(ocrItem.bounds.right);
    console.log(ocrItem.bounds.top);
    console.log(ocrItem.bounds.bottom);
}
